package self.hoy.demo.cloud;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 不能放在 @ComponentScan 注解所在包或子包下
 * eureka负载均衡规则演示，需要配合在 <@link> OrderStarter</@link> 上添加 @RibbonClient
 */
@Configuration
public class PaymentBalanceRule {

    @Bean
    public IRule myRandomRule() {
        return new RandomRule();
    }
}
